﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using GameSushi.TweenEngine;

namespace GameSushi.SourceGame
{
    public class SushiAccessor : TweenAccessor<Sushi>
    {
        public const int POS_XY = 1;
        public const int SCALE_XY = 2;
        public const int ROTATION = 3;

        public override int GetValues(Sushi target, int tweenType, float[] returnValues)
        {
            switch (tweenType)
            {
                case POS_XY:
                    returnValues[0] = target._pos.X;
                    returnValues[1] = target._pos.Y;
                    return 2;
                case SCALE_XY:
                    returnValues[0] = target._scale;
                    //returnValues[0] = target._pos.X;
                    return 2;
                case ROTATION:
                    returnValues[0] = target._rotation;
                    return 2;
                default:
                    return -1;
            }
        }

        public override void SetValues(Sushi target, int tweenType, float[] newValues)
        {
            switch (tweenType)
            {
                case POS_XY:
                    target._pos = new Microsoft.Xna.Framework.Vector2(newValues[0], newValues[1]);
                    break;
                case SCALE_XY:
                    target._scale = newValues[0];
                    break;
                case ROTATION:
                    target._rotation = newValues[0];
                    break;
                default:
                    break;
            }
        }
    }
}
